/*
 * @Descripttion: 
 * @version: 
 * @Author: zhaomangang
 * @Date: 2024-06-15 09:59:01
 * @LastEditors: zhaomangang
 * @LastEditTime: 2024-06-25 17:28:01
 */
#ifndef __AUDIO_CAPTURE_H__
#define __AUDIO_CAPTURE_H__

#include <QObject>
#include <QAudioInput>
#include <QFile>
#include <iostream>
#include <memory>

class AudioCapture : public QObject
{
    Q_OBJECT
public:
    explicit AudioCapture(QObject *parent = nullptr);
    ~AudioCapture();
    void initAudioDevice();
    /* Start recording, file name passed in by caller */
    void startCapture(QString filename = "./capture.pcm");
    /* End the recording and return to the full path of the recording file */
    QString stopCapture();
    
signals:


private:
    std::shared_ptr<QAudioInput> audio_input_;
    std::shared_ptr<QFile> file_;
};


#endif // __AUDIO_CAPTURE_H__
